package com.akaovi.pojo;

/**
 * @author akaovi
 * @version 1.0
 * @description
 * @date 2022/11/7 14:13
 * @since 2022/11/7 14:13
 */
public class HourlyEmployee extends Employee {
    private double hourSalary;
    private int hour;

    public HourlyEmployee() {
    }

    public HourlyEmployee(String name, int birth, double hourSalary, int hour) {
        super(name, birth);
        this.hourSalary = hourSalary;
        this.hour = hour;
    }

    public double getHourSalary() {
        return hourSalary;
    }

    public void setHourSalary(double hourSalary) {
        this.hourSalary = hourSalary;
    }

    public int getHour() {
        return hour;
    }

    public void setHour(int hour) {
        this.hour = hour;
    }

    public double getSalary(int month) {
        if (hour <= 160) {
            return hourSalary * hour + super.getSalary(month);
        } else {
            return 160 * hourSalary + (hour - 160) * hourSalary * 1.5 + super.getSalary(month);
        }
    }

}

